00001 init();
00002
00003 function init() {
00004 tables = document.getElementsByTagName('table');
00005 for (i = 0; i < tables.length; i++) {
00006 table = tables[i];
00007 if (table.className == 'tableBorder') {
00008 plus = document.createElement('a');
00009 plus.appendChild(document.createTextNode('Alles ausklappen (+)'));
00010 plus.title = 'Alle Kurse und Module ausklappen';
00011 plus.style.cursor = 'pointer';
00012 plus.onclick = showAll;
00013 table.parentNode.insertBefore(plus, table);
00014
00015 table.parentNode.insertBefore(document.createTextNode(' / '), table);
00016
00017 minus = document.createElement('a');
00018 minus.appendChild(document.createTextNode('Alles einklappen (-)'));
00019 minus.title = 'Alle Kurse und Module einklappen';
00020 minus.style.cursor = 'pointer';
00021 minus.onclick = hideAll;
00022 table.parentNode.insertBefore(minus, table);
00023 }
00024 }
00025
00026 rows = document.getElementsByTagName('tr');
00027 for (i = 0; i < rows.length; i++) {
00028 row = rows[i];
00029 if (row.className == 'tableHead' || row.className == 'tableCellHead') {
00030 plus = document.createElement('a');
00031 plus.appendChild(document.createTextNode('+'));
00032 plus.style.cursor = 'pointer';
00033 plus.onclick = show;
00034 row.firstChild.appendChild(document.createTextNode(' '));
00035 row.firstChild.appendChild(plus);
00036
00037 minus = document.createElement('a');
00038 minus.appendChild(document.createTextNode('-'));
00039 minus.style.cursor = 'pointer';
00040 minus.onclick = hide;
00041 row.firstChild.appendChild(document.createTextNode(' '));
00042 row.firstChild.appendChild(minus);
00043 if (row.className == 'tableHead') {
00044 plus.title = 'Diesen Kurs ausklappen';
00045 minus.title = 'Diesen Kurs einklappen';
00046 } else {
00047 plus.title = 'Dieses Modul ausklappen';
00048 minus.title = 'Dieses Modul einklappen';
00049 }
00050 }
00051 }
00052 }
00053
00054 function hideAll() {
00055 rows = document.getElementsByTagName('tr');
00056 for (i = 0; i < rows.length; i++) {
00057 row = rows[i];
00058
00059 if (row.className == 'tableCell' || row.className == 'tableCellDark') {
00060 row.style.display = 'none';
00061 }
00062 }
00063 return false;
00064 }
00065
00066 function hide() {
00067 row = this.parentNode.parentNode;
00068 first = true;
00069 hideAll = row.className == 'tableHead';
00070
00071 for (; row != null; row = row.nextSibling) {
00072 if (row.className == 'tableCell' || row.className == 'tableCellDark') {
00073 row.style.display = 'none';
00074 } else if (!hideAll && (row.className == 'tableHead' || row.className == 'tableCellHead')) {
00075 if (first) {
00076 first = false;
00077 } else {
00078 break;
00079 }
00080 }
00081 }
00082 return false;
00083 }
00084
00085 function showAll() {
00086 rows = document.getElementsByTagName('tr');
00087 for (i = 0; i < rows.length; i++) {
00088 row = rows[i];
00089
00090 if (row.className == 'tableCell' || row.className == 'tableCellDark') {
00091 row.style.display = '';
00092 }
00093 }
00094 return false;
00095 }
00096
00097 function show() {
00098 row = this.parentNode.parentNode;
00099 first = true;
00100 showAll = row.className == 'tableHead';
00101
00102 for (; row != null; row = row.nextSibling) {
00103 if (row.className == 'tableCell' || row.className == 'tableCellDark') {
00104 row.style.display = '';
00105 } else if (!showAll && (row.className == 'tableHead' || row.className == 'tableCellHead')) {
00106 if (first) {
00107 first = false;
00108 } else {
00109 break;
00110 }
00111 }
00112 }
00113 return false;
00114 }